<p class="title"><%= 'Search results'.t %></p>
<% unless @result.blank? %>
  <%= 'Your query'.t %>: <i><%= @search_query %></i><br>
  <%= 'Results found'.t %>: <i><%= @result.size %></i><br>
  <br>
  
  <table class="grid">
  
  <% @result.each do |file| %>
    <% odd_or_even = cycle('even', 'odd') %>
    <tr class="<%= odd_or_even %>">
      <td width="16"><%= image_tag('file.png') %></td>
      <td><%= h(file.filename) %> (<%= file.filesize %> KB)
      <%= '<br />' + 'Tags: '.t + tags_of(file) if file.tag_list.length > 0 %></td>
      <td align="right"><%= link_to 'Download'.t, :controller => 'file', :action => 'download', :id => file.id %> | <%= link_to 'Preview'.t, :controller => 'file', :action => 'preview', :id => file.id, :search => @search_query %>&nbsp;</td>
    </tr>
    <tr class="<%= odd_or_even %>">
      <td colspan="3" class="smallResult"><%= h(file.highlight(@search_query, { :field => :text, :pre_tag => '[highlight]', :post_tag => '[/highlight]' })).gsub('[highlight]', '<b>').gsub('[/highlight]', '</b>') %></td>
    </tr>
  <% end %>
  
  </table>

<% else %>
  <i><%= 'Sorry, no results for your query'.t %> "<%= @search_query %>"</i>
<% end %>